import 'package:auto_route/auto_route.dart';
import 'package:flutter/cupertino.dart';

import '../config/app_router.dart';

@RoutePage()
class TabPage extends StatelessWidget {
  const TabPage({super.key});

  @override
  Widget build(BuildContext context) {
    return AutoTabsScaffold(
      routes: const [
        HomeRoute(),
        MessageRoute(),
        ProfileRoute(),
      ],
      bottomNavigationBuilder: (_, tabsRouter) {
        return CupertinoTabBar(
          currentIndex: tabsRouter.activeIndex,
          onTap: tabsRouter.setActiveIndex,
          items: const [
            BottomNavigationBarItem(icon: Icon(CupertinoIcons.home), label: '首页'),
            BottomNavigationBarItem(icon: Icon(CupertinoIcons.chat_bubble_2), label: '消息'),
            BottomNavigationBarItem(icon: Icon(CupertinoIcons.person), label: '我的'),
          ],
        );
      },
    );
  }
}
